Certificate image extraction method and terminal device

ABSTRACT

A certificate image extraction method, including: step S101, obtaining an original image containing a certificate image, wherein the original image is obtained by a camera device by means of photographing; step S102, performing white balance processing on the original image to obtain a balance image according to component values of pixel points in the original image in red, green and blue color components; step S103, determining a position of the certificate image in the balance image according to a pre-trained certificate feature model; wherein the certificate feature model is obtained by training based on historical certificate images, a certificate image model and a preset initial weight value; and step S104, extracting the certificate image from the balance image according to the position of the certificate image. By performing the certificate image extraction method, the accuracy of extracting the certificate image from the original image is improved.

CROSS-REFERENCE TO RELATED APPLICATION

The present application is a continuation-in-part application of PCTApplication Ser. No. PCT/CN2019/118133 with an international filing dateof Nov. 13, 2019, which claims priority to Chinese patent applicationNo. 201910023382.2, filed with China National Intellectual PropertyAdministration on Jan. 10, 2019, and entitled “certificate imageextraction method and terminal device”, the contents of which areincorporated herein by reference in entirety.

TECHNICAL FIELD

The present disclosure relates to the technical field of computerapplications, and particularly relates to a certificate image extractionmethod, a terminal device and a non-volatile computer readable storagemedium.

BACKGROUND

Machine vision enables an “object” to have the function of viewing, themachine vision can not only have information acquisition function, butalso perform high-level functions such as processing and recognition. Inaddition, the cost of equipment used for machine vision is low, the mostfrequently used device is a camera. According to the statistics, thequantity of installations of public cameras in large cities and camerasat home and in enterprises in recent years has been greatly increased,the quantity of installations of the home cameras and enterprise camerasis also huge, many cameras may be used in the corners of cities or athome and in the enterprises in the future with the popularization ofcameras. With the rapid popularization of cameras, relevant applicationsof machine vision technology will be developed more rapidly. With thedevelopment of the technical field of machine vision, certificateidentity verification technique will also be widely used in this machinevision tide.

In the prior art, cameras arranged at everywhere of the cities can becalled to perform identity authentication at any time, so that findingthe information of a specialized person in tens of thousands of peoplebecomes simple. However, due to the influences of many externalenvironments, the quality of obtained certificate image is poor, andthus accurate certificate images cannot be obtained.

Technical Problem

Embodiments of the present disclosure provide a certificate imageextraction method, a terminal device and a non-volatile computerreadable storage medium, which aims at solving the problem in the priorart that the quality of obtained certificate image is poor andinaccurate due to influences of many external environments.

Technical Solution

In the first aspect, embodiments of the present disclosure provide acertificate image extraction method, performed on a terminal device,including:

obtaining an original image containing a certificate image, wherein theoriginal image is obtained by a camera device by means of photographing;

performing white balance processing on the original image to obtain abalance image according to component values of pixel points in theoriginal image in red, green and blue color components;

determining a position of the certificate image in the balance imageaccording to a pre-trained certificate feature model; wherein thecertificate feature model is obtained by training based on historicalcertificate images, a certificate image model and a preset initialweight value; and

extracting the certificate image from the balance image according to theposition of the certificate image.

In the second aspect, embodiments of the present disclosure provide aterminal device, including a memory, a processor and a computer readableinstruction stored in the memory and executable by the processor, theprocessor is configured to execute the computer readable instruction toimplement following steps:

obtaining an original image containing a certificate image, wherein theoriginal image is obtained by a camera device by means of photographing;

performing white balance processing on the original image to obtain abalance image according to component values of pixel points in theoriginal image in red, green and blue color components;

determining a position of the certificate image in the balance imageaccording to a pre-trained certificate feature model; wherein thecertificate feature model is obtained by training based on historicalcertificate images, a certificate image model and a preset initialweight value; and

extracting the certificate image from the balance image according to theposition of the certificate image.

In the third aspect, embodiments of the present disclosure provide anon-volatile computer readable storage medium which stores a computerreadable instruction, the computer readable instruction is configured tobe executed by a processor to cause the processor to perform the methodin the first aspect.

Advantageous Effects

In the embodiments of the present disclosure, the original imagecontaining the certificate image is acquired; the original image isobtained by the camera device through photographing; the white balanceprocessing is performed on the original image according to the componentvalues of each pixel point in the original image in red, green, and bluecolor components, and the balance image is obtained; the position of thecertificate image in the balance image is determined according to thepre-trained certificate feature model; the certificate feature model isobtained by training based on the historical certificate images, thecertificate image model and the preset initial weight value; the imageof the certificate is extracted from the balance image according to theposition of the certificate image. The position of the certificate inthe original image is determined according to the certificate featuremodel, and the certificate image in the image is extracted, so that theaccuracy of extracting the certificate image from the original image isimproved.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a schematic flowchart of a certificate imageextraction method according to embodiment one of the present disclosure;

FIG. 2 illustrates a schematic flowchart of a certificate imageextraction method according to embodiment two of the present disclosure;

FIG. 3 illustrates a schematic diagram of a terminal device according toembodiment three of the present disclosure; and

FIG. 4 illustrates a schematic diagram of the terminal device accordingto embodiment four of the present disclosure.

DESCRIPTION OF THE EMBODIMENTS

In the following descriptions, in order to describe but not intended tolimit the present disclosure, concrete details such as specific systemstructure, technique, and the like are proposed, so that a comprehensiveunderstanding of the embodiments of the present disclosure isfacilitated. However, it will be apparent to the ordinarily skilled onein the art that, the present disclosure may also be implemented in someother embodiments without these concrete details. In some otherconditions, detailed explanations of method, circuit, device and systemwell known to the public are omitted, so that unnecessary details can beprevented from obstructing the description of the present disclosure.

In order to illustrate the technical solutions of the presentdisclosure, the technical solutions of the present disclosure aredescribed below with reference to detailed embodiments.

Referring to FIG. 1, FIG. 1 illustrates a flowchart of a certificateimage extraction method according to embodiment one of the presentdisclosure. The executive subject of the certificate image extractionmethod in this embodiment is a terminal device. The terminal deviceincludes, but is not limited to, a mobile terminal such as a smartphone, a tablet computer, a wearable device, etc. The terminal devicemay also be a desktop computer or the like. The certificate imageextraction method as shown in FIG. 1 may include the following steps:

In step of S101, obtaining an original image containing a certificateimage; wherein the original image is obtained by a camera device bymeans of photographing.

With the development of real name registration in the society, rapid andaccurate collection of certificate information has become a more andmore important topic, the improvement of hardware performance and thehigh-speed development of digital image processing technology greatlyfacilitates the improvement of performance of certificate informationacquisition system. The certificate image processing part, which affectsthe overall performance of the certificate information acquisitionsystem, has large influence on the performance of the system, andcorresponding processes are also different upon different systems.Social requirements on public safety are becoming higher and higher withthe improvement of national laws and regulations, thus, relevantdepartments put real name registration into force in many aspects ofsocial people's livehood, such as real name registration in Internetsurfing and account opening, mobile phone real name registration, andthe like. If extraction of personal information is merely depends onmanual entering and checking, low work efficiency and higher error rateis caused inevitably, and serious inconveniences are brought to the twoparties in business. The certificate information acquisition system mayrealize automatic extraction of certificate information, and recordingof certificate certificates such as recognition card, passport and thelike through radio frequency recognition technology and imagerecognition technology. The development of the information acquisitionapproaches and the development of image processing technology make thespace of certificate reader to be smaller, and make the speed ofinformation extraction to be faster, and reduce error rate ofinformation. Great convenience is brought to two parties in businesswhile public safety and management efficiency are improved. In addition,the certificate information acquisition system also facilitates thedevelopment of applications of real name registration. The developmentof the certificate information acquisition system enables real nameregistration to be conducted in the scenarios of huge human traffic flowsuch as the train, the car, the subway and the like, which greatlyguarantees safeties in railway, highway and urban subway traffic.

A mobile intelligent terminal refers to a terminal which has a varietyof operating systems like a computer, but is relatively smaller involume with respect to a computer, is convenient to be carried, and hasa wireless internet surfing function, so that a user may downloadvarious applications of the corresponding operating system according tohis/her own demand. Mobile intelligent terminals which are common indaily life include a smart phone, a tablet computer, a vehicle-mountedcomputer, a wearable mobile device and the like. Smart phone iscurrently commonly used mobile intelligent terminal, the user mayinstall an application, a game or a functional program according to athird-party service provider into the intelligent terminal according tohis/her own preference or demand, in this way, the requirements of theuser on the functions of the intelligent terminal are met. In recentyears, with the continuous development of technology, variouscertificates are no longer a certificate, but rather a card like anidentity card. With the use of certificates, recording of certificateinformation becomes an important issue, too. The traditional informationrecording mode is that information in the relevant table is filled in amanual mode, then, key information is stored in the computer by aninternal worker according to the contents in the table, or thecertificate is scanned and uploaded at a designated place. Regarding thefirst information recording manner, although the location where theinformation is recorded is not limited, a large amount of humanresources and material resources need to be consumed every time when theinformation is recorded, and an erroneous record is prone to occur. Forthe second information recording manner, even though there is animprovement in the efficiency and accuracy of information recording, theplace of use is relatively fixed. The presence of the mobile intelligentterminal makes it possible to record certificate information anytime andanywhere. The information recognition system on the mobile intelligentterminal may be widely applied to the departments that need to checkcertification information, such as service industries, traffic systems,public security systems, etc. The certificate information may becollected and checked without a large number of employees, theefficiency and the accuracy of recognition of the certificateinformation in collection and checking are improved, and thisinformation recognition system has a wide application scope.

In practical application, the user may upload the original imagecaptured by the mobile terminal to a server or an image processingterminal, the image processing terminal processes and recognizes theoriginal image after receiving the original image. An applicationscenario in the present solution may be a website where the usercertificate image is acquired and verified, an image acquisitioninstruction is sent to the user, the user takes a picture, such as apicture of identity card, a picture of passport and the like usinghis/her own terminal device, and sends the captured picture to theexecutive subject through application software or webpage in the mobileterminal, the executive subject processes and recognizes the originalimage after obtaining the original image.

In step of S102, performing white balance processing on the originalimage to obtain a balance image according to component values of pixelpoints in the original image in red, green and blue color components.

In a practical application, the most commonly used color spacerepresenting the image is RGB (Red, Green, Blue). The three colorcomponents of the true color image are represented by a bit of one byterespectively, thus, a space of one point needs to be represented using 3bytes, and a 1024×768 true color image with a resolution of 1024×768requires a storage of 1024×768×3=2.25 MB. Such a big storage occupationis a great expenditure on early computer, and this storage occupationalso appears to be huge in some environments where memory space isrelatively small, such as cell phone. Thus, all colors in the image arestored in one table, the actual image data is no longer RGB data, butinstead is the index in table where the RGB data is stored, in order tocontrol the storage space of index, the requirement on the storage spaceof the table is less than 256 elements, that is, an range represented by1 byte, this byte may represent the color of one point in this image. Ifthe table is smaller, the bits of the number of indexes used by onepoint is smaller, in this way, a true color image 256 color palette withthe resolution of 1024×768 only requires 1024×768×3=768.8 KB. Two typesof palettes are always used in color quantification, one type of paletteis a true color or a pseudo-true color image which is quantified intopalette image; another type of palette is a palette image that iscontinued to be quantified. With the continuous increasing of storagecapacity of computer, the palette image gradually fades out of the stageof the personal computer, however, the palette image is still widelyused in some special equipment such as mobile phones, especially in gameapplications of mobile phones.

With the development of computer technology, processing of graphics andimages have been widely used in the various fields such as industry,agriculture, military, medicine, management and the like. Colorfuloriginal images in the nature may be collected using the devices such asa color scanner, a camera and the like. When the original images aredisplayed on a computer, the number of colors that may be represented isalways limited due to the performances that can be according to thedisplay device and economic reasons. In another aspect, the number ofcolors that may be displayed by different conditions of computer deviceare always different, it is desirable to enable the same image to bebetter represented under the condition of lower level of machineequipment.

In practical application, the balance is an indicator that describes theaccuracy of white color which is generated after three primary colors ofred, green, and blue are mixed in the display. White balance is a veryimportant concept in the field of television imaging, and a series ofproblems with color reduction and tone processing may be solved throughwhite balance. White balance is generated while an electronic imagereproduces true color, and is early used in the field of professionalphotography, and is currently widely used in household electronicproducts. However, the development of technology makes adjustment ofwhite balance to be simpler and easier, many users do not even know theprinciple of white balance, and there are many misunderstandings for theusers. White balance enables a camera image to accurately reflect colorcondition of an object. In this embodiment, white balance processing maybe performed on the original image by means of manual white balance andautomatic white balance to obtain the balance image.

In step of S103, determining the position of the certificate image inthe balance image according to a pre-trained certificate feature model;wherein the certificate feature model is obtained by training based onthe historical certificate image, the certificate image model and thepreset initial weight value.

When recognizing a character of a certificate, certificate recognitionmethods mainly include a hidden Markov model, a neural network, asupport vector machine, and a template matching. All methods usingHidden Markov Model require preprocessing and setting parametersaccording to existing knowledge. This method achieves a higherrecognition rate through complex preprocessing and parameterization, andmay also train a certificate feature model through a multi-layer sensingneural network. The neural network is trained using a backward feedbackmethod, and a relative good result may be obtained only if this networkhas been trained many times. This process is time-consuming, and thenumber of layers of hidden layers and the number of neurons of thehidden layer must be obtained by experimental method. Optionally, theneural network includes 24 input layer neurons, 15 hidden layer neurons,36 output layer neurons which recognize the certificate in the balanceimage.

There are countless neurons in human brain, there are innumerablecontacts among these neurons, a tight neural network structure is formedthrough organization, which implements complex computations andfunctions of the human brain. The neural networks here primarilystudying connection ways of these neurons and organizational structures.Regarding neural networks, the neural networks may be divided into twotypes, one type is layered neural network, the other type is reticularneural network. Regarding the first type of neural network, the neuronsare arranged in a hierarchical manner, the neurons are arranged inparallel to form a tight mechanism in each layer, layers areinterconnected by neurons, however, the neurons inside each layer cannotbe interconnected; regarding the second type of neural networkstructure, the neurons may be interconnected.

It should be noted that, there is a need to perform some training on theneural network. Rules and methods of processing of neural networks areleaned, and problems are processed and settled by these methods. Thereare specifically several steps to implement forward multi-layer networkstructure, firstly, a training example for the forward multi-layernetwork needs to be provided. An input and output mode is included inthis example; regarding the training of the above design, certain errorsare allowed for input and output; changes need to be made for the outputof the forward multi-layer network. The output is changed such that abetter output may be obtained, and the condition that the output iswithin error range is satisfied.

In step of S104, extracting an image of the certificate from the balanceimage according to the position of the certificate image.

The certificate image is extracted from the balance image according tothe position of the certificate image, after the position of thecertificate image in the balance image is determined. In particular, thecertification image extraction method may be extracting the certificateimage by directly cropping from the balance image, and may also be amethod for reserving the certificate image by removing the image areaexcluding the certificate image, the certification image extractionmethods are not limited here.

In addition, image edge of the certificate image may also be detectedbased on an edge and gradient method, the certificate image is extractedbased on the image edge. In the edge-based certificate image method, itis considered that there is a great difference between the certificateimage and background edge in natural scene, edge detection is performedon the characters according to this method, so that the position of thecertificate image is determined through edge information. Optionally,the image edge of the certificate image may be determined by a Sobeloperator, a Robert operator, a Laplace operator. Wherein the Sobeloperator determines whether the point is an edge point by determiningwhether a gradient of a certain pixel point in the certificate image isgreater than a threshold value, the Robert operator is suitable for theimages in which there is a great difference between characters and imagebackground, the edge which is obtained after detection is thicker, theLaplace operator is very sensitive to noise, and is prone to generate abilateral effect, and thus is not directly used for detecting the edge.The original image is converted into a binary image according to acertificate image positioning method based on connected domain, theinfluence of noise is reduced, areas of the certificate image arecommunicated by using a morphology corrosion expansion algorithm, theimage is segmented by using a distinction degree between the certificateimage and white background, then, the connected domain of the image ofnon-certificate area is excluded according the various features of thecertificate image, and the certificate image area is obtained, thecertificate image positioning speed is faster and the efficiency ofrecognizing certificate image and the characters in the certificateimage may be improved according to the certificate image positioningmethod based on connected domain.

According to the technical solution mentioned above, the original imageincluding the certificate image is obtained; the original image isobtained by a camera device by photographing; white balance processingis performed on the original image to obtain a balance image accordingto component values of pixel points in the original image in red, green,and blue color components; the position of the certificate image in thebalance image is determined according to the pre-trained certificatefeature model; the certificate feature model is obtained by trainingbased on historical certificate images, a certificate image model andthe preset initial weight value; and the certificate image is extractedfrom the balance image according to the position of the certificateimage. The position of the certificate in the original image isdetermined according to the certificate feature model, and thecertificate image in the image is extracted, so that the accuracy ofextracting the certificate image from the original image is improved.

Referring to FIG. 2, FIG. 2 illustrates a flowchart of a certificateimage extraction method according to embodiment two of the presentdisclosure. The executive subject of the certificate image extractionmethod in this embodiment is a terminal device. The terminal deviceincludes, but is not limited to, mobile terminal such as a smart phone,a tablet computer, a wearable device, etc. The terminal device may alsobe a desktop computer or the like. The certificate image extractionmethod as shown in FIG. 2 may include the following steps:

In step of S201, collecting historical certificate images, and obtaininga target image by screening the historical certificate images accordingto a preset target image requirement.

Before recognizing and processing the original image, the certificatefeature model needs to be trained to recognize the certificate image.Thus, the certificate feature model may be firstly trained according tothe historical certificate images, so that the certificate image isextracted from the original image. The data used for training thecertificate feature model in the present solution may be the historicalcertificate images which include historical images acquired before thecertificate image is extracted.

In practical application, the acquired historical certificate images mayhave an unqualified image, taking this into consideration, the acquiredhistorical images are screened according to a preset requirement ontarget image to obtain the target image. Wherein the preset target imagerequirement may be the requirement on pixels, size, and photographingtime of the image, in addition, the preset target image requirement mayalso be detecting the integrity of the image, and the requirement of thetype of the certificate image, and the like. These requirements may bedetermined by the operator, and are not limited here; after determiningthe requirement on target image, matching is performed on the acquiredhistorical certificate images according to the requirement on targetimage, and the historical certificate image which has a matching degreegreater than a matching degree threshold is determined as the targetimage.

The certificate images which are obtained through various camera devicesare used as initial samples for training neural network. In the learningand training process of the neural network, the selection of thetraining set will directly affect the time, the weight value matrix andthe effect of learning and training of network learning training. In thepresent solution, the images which have obvious image edges, and theimage edges distributed at most areas of the image are selected as theinitial samples of the training set, the image edge is clearer, particleedges are distributed at everywhere of the image, and the texturefeatures of the image are abundant, so that the neural network may bewell trained, network information such as network weight valueinformation may record more edge information, and the image may bebetter detected.

In step of S202, performing pixel recognition on the target imageaccording to a preset certificate image template, and determining atleast one central pixel point in the target image.

When determining a center pixel point in the image sample, arepresentative pixel point in the image sample may be determined as thecenter pixel point through image recognition. For example, when theprocessed original image is the image of identity card photographed by auser, four corners of an avatar may be determined as the center pixelpoint according to the size of avatar and the positions of characters inthe known image of identity card, some characters such as the first wordin the identity card or the first word in each row may also bedetermined as the central pixel points; furthermore, the acquired imagetypes may also be preset, such as the the image of identity card, acertificate of real estate, etc., and information including each type ofimage template and the position of each image element in the template,the distance between the image element and certificate frame isdetermined, recognition is performed according to the information so asto accurately determine the center pixel point in the image sample,learning and training are performed through the central pixel point andthe surrounding pixel points centered around the central pixel point todetermine the position of the certificate in the original image.

It should be noted that, there may be at least two pixel points aroundthe center pixel point, preferably, eight pixel points around thecentral pixel point may be determined to perform learning and training,so that the situation of each pixel in the image is determined moreclearly.

In step S203, setting an initial parameter of the training model,performing learning and training according to the initial parameters andpixel values of each central pixel point and pixel points around thecentral pixel point so as to obtain a certificate feature model based onthe neural network.

As for any neural network model, learning and training in applicationprocess is a key point, the network may have capacities of association,memorization, and prediction through learning and training. Generally,the determination of certain parameters is critical to learning andtraining process. The initial parameters of the network include theinitial network architecture, the weight value of connection, thethreshold and the learning rate, etc., different settings influences therate of convergence of the network to some extent. The selection ofinitial parameters is not only very important but also very difficult.In addition to necessary technical processing, the establishment ofnetwork is mainly upon observation and experience.

In the training process of certificate feature model, the initial valueof the model is determined firstly, the initial weight value and thethreshold value of the network are generally selected randomly from therange of [−1, 1] or [0, 1], this range would be appropriately changed bysome improved algorithms. Secondly, normalization processing isperformed on a vector, in the learning and training process, it isinappropriate to make node input be too large, too small weight valueadjustment is not beneficial to network learning and training. Imagetraining is gray-based, thus, image matrix is a shaping value in therange of [0, 255], the dimension of feature vector is relatively high,in order to improve network training speed, a normalization process willbe performed on the feature vector. The feature vector is taken as a rowvector, and is expressed as:

X=(x₀, x₁, . . . , x₉), wherein x₀, x₁, . . . , x₉, is used to representthe center pixel point and its surrounding pixel points, respectively.

There may be at least two pixel points around each central pixel pointin this embodiment, the number of pixel points may be 8 preferably, sothat the condition of the surrounding pixel points of the central pixelpoint is described more accurately, gray value of 8-bit grayscale imageis in the range of [0, 255], therefore, in actual processing, anormalization formula in the actual process is expressed as:

${{X^{\prime} = \frac{x_{0}}{255}};{i = 1}},2,\ldots \;,{9;}$

wherein x₀ is used to represent the pixel value of the central pixelpoint.

Since the object to be processed is image, the image sample set isrelatively huge, and thus an idea of dividing the image into blocks isadopted. Each time an image sample is input in the neural network, thegray values of these pixels may be input into the input layersequentially from top to bottom and from left to right by determiningone or at least two center pixel points and performing learning andtraining on template pixels around the central pixel points, that is, 8pixels around the center pixel points. There is a deviation valuebetween the gray value of the expected output pixel provided by theoutput layer and the gray value of the output pixel of the actual outputlayer, and this deviation value is propagated in a reverse direction,which enables the threshold value of each neuron and the connectedweight value between the neurons to be changed, in this way, the networkmay effectively record more edge information. The process describedabove is repeatedly performed until the deviation value is reduced to bewithin a specified range, or the number of training times reaches thetarget number of times and the task of training is completed. It isspecified in the training requirement that the training of the networkmay be stopped at any time, meanwhile, in order to facilitate future useof the neural network for detection, the trained weight value and thethreshold value are all stored in a backend database, the trainednetwork is saved finally.

In step of S204, obtaining the original image containing a certificateimage; wherein the original image is obtained through photographing by acamera device.

In this embodiment, the step S204 has an implementation mode identicalto that of Step S101 in the embodiment corresponding to FIG. 1,regarding the implementation mode of step S204, reference may be made tothe related descriptions in the step S101 in the embodimentcorresponding to FIG. 1, the implementation mode of step S204 is notrepeatedly described here.

In step of S205, performing white balance processing on the originalimage according to the component values of pixel points in the originalimage in red, green and blue color components to obtain a balance image.

After obtaining the original image, white balance processing isperformed on the original image according to the component values in thered, green and blue color components of each pixel point in the originalimage to obtain a balance image.

Further, step S205 may specifically include following steps S2051-S2052:

In step of S2051, estimating an average chromatic aberration of each ofthe pixel points in the original image according to a component value ofeach of the pixel points in the original image in red, green, and bluecolor components.

The processing of performing filtering interference information,enhancing effective information on image before performing morphologicalprocessing or matching or recognition on image is referred to as imagepreprocessing. The primary purpose of preprocessing of image is toeliminate interference or irrelevant information in the image, torecover useful real information, to enhance detectability of therelevant information, and to simplify data to the maximum extent,thereby improving the reliability of feature extraction, imagesegmentation, matching and recognition. The preprocessing on digitalcolor images is generally brightness, restoration and enhancement ofcolor. In view of the comparison and testing on various preprocessing,it is found that white balance processing has a relatively strongerinfluence on the final image segmentation result of the system, and haslittle influence on other preprocessing. Thus, said preprocessing in thepresent solution mainly refers to processing of white balance.

Different light sources have different spectral components anddistributions, this phenomenon is referred to as color temperature. Awhite object tends to be red under illumination of light of low colortemperature, and tends to be blue under illumination of light of highcolor temperature. When performing photographing, the color temperatureof the ambient light source will have an effect on the image, and causeschromatic aberration of the image inevitably. In order to reduce theinfluence of ambient light on target color as much as possible, suchthat the original color of the object to be photographed may berecovered under different color temperature conditions, color correctionis required to achieve correct color balance.

When three colors of red, green, and blue in the image are identical,the chromatic aberration of light is 0 and light appears as white. Inimage processing, YBR color model is usually used to calculate chromaticaberration. A correspondence relationship between the YBR color systemand the RGB color system is as follows:

$\begin{bmatrix}Y \\B \\R\end{bmatrix} = {\begin{bmatrix}0.2990 & 0.5870 & 0.1140 \\{- 0.1687} & {- 0.3313} & 0.5000 \\0.5000 & {- 0.4187} & {- 0.0813}\end{bmatrix}\begin{bmatrix}R \\G \\B\end{bmatrix}}$

A region is defined in the space where Y is large enough, B and R aresmall enough, and all pixels in the region are considered as white, andmay participate in the calculation of chromatic aberration. The averagechromatic aberration of the white pixels is then used to represent thechromatic aberration of the entire image to achieve better accuracy.According to the characteristics of the system, a constraint isprovided, and this constraint is expressed as follows: Y−|B|−|R|>180.The pixels satisfying the constraint condition are all considered aswhite, the average luminance of the white pixel point and the averagevalue of red, green, and blue components are obtained.

In step of S2052, determining gain amount of each of the pixel points inred, green, and blue color components according to the average chromaticaberration of each of the pixel points.

In practical application, color gain is used to represent a freshnessdegree of the image, the gain amount increases color contrast, the coloris more vivid and more saturated, and a stronger visual impact iscaused; in another aspect, certain sharpening effect is generated, sothat the lines in the edge are sharper and clearer. Some functions ofthe image including contrast and color saturation may be automaticallyadjusted by color gain. This technique used in digital camera may makethe photograph to appear clearer and eye-catching.

According to the average chromatic aberration calculated according tothe previous step, the gain amount of each component of the whitebalance may be obtained, the gain amount is expressed as follows:

$\left\{ {\begin{matrix}{R_{g} = {Y_{avg}\text{/}R_{avg}}} \\{G_{g} = {Y_{avg}\text{/}G_{avg}}} \\{B_{g} = {Y_{avg}\text{/}B_{avg}}}\end{matrix}\quad} \right.$

In step of S2053, correcting, according to the gain amount, the colortemperature of each pixel point in the original image to obtain thebalance image.

In the present solution, color temperature correction is performed oneach pixel of the whole image according to the gain amount obtained inthe previous step, and the calculation formula is particularly expressedas follows:

$\left\{ {\begin{matrix}{R_{new} = {R_{g} \cdot R}} \\{G_{new} = {G_{g} \cdot G}} \\{B_{new} = {B_{g} \cdot B}}\end{matrix}\quad} \right.$

Optionally, image enhancement may also be performed to eliminate orreduce noise in the image, enhanced contrast in the image improvespositioning of text area. Horizontal correction of the image isconverting the original image into the image in which characters arehorizontally distributed, so that accuracy of positioning the areas ofcharacters is improved. The image enhancement method may be Gaussianblur and sharpening processing, the image Gaussian blur process is acommon method for detail fuzzification and noise reduction, the Gaussianblur process weight values and adds 8 connected domains of the point bycertain weight value, and takes the weight value as the pixel value ofthe point. Many noises in the image may be smoothed and the contour ofthe target image in the image may be highlighted using a Gaussian blursmoothing process. The Gaussian blur smoothing process is onlyapplicable to the image in which image background is complex and thecontour of the target in the image is significant. The details of theimage may be smoothed through smoothing process, and some of theinsignificant contour details may also be smoothed under the conditionof smooth noise.

In addition, smoothing and filtering of the image may also be performedon the original image, and some measures are taken for the reduction inthe quality of the image caused during the generation of the image. Thequality of the image may be improved. In particular, some information ofthe image is compensated in a targeted manner. Another method isprocessing the image to protrude information of a part of the image.Furthermore, the image information which is not very important isfurther reduced. In the image processing of the certificate, it is oftendesirable to obtain image information of certificate using a certificatecollection tool. Some noises are often generated during this process.Therefore, there is a need to attempt to reduce noise. The quality ofthe image may be improved according to this method. The generated noisesmay be disturbed. Better image information is obtained. Important imagesinformation is enhanced. The technique of image preprocessing issmoothing of the image. For image smoothing techniques, the enhancementeffect of the image is mainly achieved according to performancerequirements and by two methods which are described as follows: firstly,important information such as lines and edge profiles of the image needsto be reserved, and they are not allowed to be destroyed casually.Secondly, regarding image, pictures of image need to be clear and imageeffect needs to be better.

In step of S206, determining the position of the certificate image inthe balance image according to a pre-trained certificate feature model;wherein the certificate feature model is trained based on historicalcertificate images, a certificate image model and the preset initialweight value.

The certificate feature model is trained according to multi-layersensing neural network, the neural network is trained using a backwardfeedback method, a relative good result may be obtained if this networkhas been trained many times. This process is time-consuming, and thenumber of layers of hidden layers and the number of neurons of thehidden layer must be obtained by an experimental method. Optionally, theneural network includes 24 input layer neurons, 15 hidden layer neurons,36 output layer neurons which recognizes the certificate in the balanceimage.

Furthermore, step S206 may specifically include step S2061:

In the step of S2061, correcting the initial parameter of thecertificate feature model, if a distance difference between the positionof the certificate obtained according to the certificate feature modeland the actual position of the certificate is greater than or equal to apreset difference threshold.

When detecting the position of the certificate image in the originalimage according to the certificate feature model, a difference betweenthe detection result and the actual result of the certificate image isprone to occur, in this case, the parameters of the certificate featuremodel may be adjusted, such that the subsequent detection result may bemore accurate. The specific implementation mode is:

determining a distance difference between a position of the certificateobtained according to the certificate feature model and an actualposition of the certificate;

if the distance difference value is greater than or equal to thedifference threshold value, the initial parameter of the certificatefeature model is corrected according to the formula expressed asfollows:

${{w_{ij}\left( {k + 1} \right)} = {{w_{ij}(k)} - {\eta \frac{\partial{E(k)}}{\partial{w_{ij}(k)}}}}};$

wherein w_(ij)(k+1) is used to represent weight value when performingthe kth training; w_(ij)(k+1) is used to represent the weight value whenperforming the (k+1)th training; η is used to represent the learningrate, and η>0; E(k) is used to represent an expected value of a positionof the certificate image obtained through the previously performed Ktimes of training.

When the actual output value of the neural network is not identical tothe expected output value, an error signal is obtained, and the errorsignal is propagated back from the output terminal, and a weightcoefficient is continuously corrected in the propagation process tominimize an error function, the network error generally use mean squareerror to modify the weight value, the formula is corrected as follows:

${w_{ij}\left( {k + 1} \right)} = {{w_{ij}(k)} - {\eta \frac{\partial{E(k)}}{\partial{w_{ij}(k)}}}}$

In this formula, the weight value w_(ij)(k) is used to represent theweight value when performing the kth training; w_(ij)(k+1) is used torepresent the (k+1)th training; η is used to represent the learningrate, and η>0; E(k) is used to represent an expected value of a positionof the certificate image obtained through the previously performed Ktimes of training,

${- \eta}\frac{\partial{E(k)}}{\partial{w_{ij}(k)}}$

represents negative gradient when performing the kth training.

In step of S207, extracting the image of the certificate from thebalance image according to the position of the certificate image.

In this embodiment, the implementation mode of the step S207 isidentical to the implementation mode of the step S105 in the embodimentcorresponding to FIG. 1, regarding the implementation mode of the stepS207, reference can be made to the relevant descriptions of the stepS105 in the embodiment corresponding to FIG. 1.

According to the present solution, the target image is obtained bycollecting the historical certificate images and screening thehistorical certificate images according to the preset target imagerequirement; pixel recognition is performed on the target imageaccording to the preset certificate image template, and at least onecentral pixel point in the target image is determined; and initialparameters of the training model is set, learning and training areperformed according to the initial parameters, pixel values of each ofthe central pixel points and the pixel points around the central pixelpoint, and a certificate feature model is obtained based on the neuralnetwork. The original image containing the certificate image isacquired; the original image is obtained by a camera device by means ofphotographing; the white balance processing is performed on the originalimage according to the component values of each pixel point in theoriginal image in red, green, and blue color components and the balanceimage is obtained; the position of the certificate image in the balanceimage is determined according to the pre-trained certificate featuremodel; the certificate feature model is obtained by training based onthe historical certificate images, the certificate image model and thepreset initial weight value; the image of the certificate is extractedfrom the balance image according to the position of the certificateimage. By preprocessing the obtained original image of the image to beextracted, the position of the proprocessed certificate is determinedaccording to the certificate feature model, the certificate image in theimage is extracted, so that the accuracy of extracting the certificateimage from the original image is improved.

Referring to FIG. 3, FIG. 3 illustrates a schematic diagram of aterminal device provided by embodiment three of the present disclosure,the various units included in the terminal device are configured toperform the various steps in the embodiments corresponding to FIG. 1 andFIG. 2. Regarding the details of these steps, reference can be made tothe relevant descriptions in the corresponding embodiments. For theconvenience of description, the part relevant to this embodiment isillustrated merely. The terminal device 300 in this embodiment includes:

an acquisition unit 301 configured to obtain an original imagecontaining a certificate image, wherein the original image is obtainedby a camera device by means of photographing;

a processing unit 302 configured to perform white balance processing onthe original image to obtain a balance image according to componentvalues of pixel points in the original image in red, green and bluecolor components;

a determination unit 303 configured to determine a position of thecertificate image in the balance image according to a pre-trainedcertificate feature model; wherein the certificate feature model isobtained by training based on historical certificate images, acertificate image model and a preset initial weight value; and

an extraction unit 304 configured to extract the certificate image fromthe balance image according to the position of the certificate image.

Furthermore, the terminal device may further include:

a screening unit configured to collect historical certificate images andobtain a target image by screening the historical certificate imagesaccording to a preset target image requirement;

a recognition unit configured to recognize pixels in the target imageaccording to a preset certificate image template, and to determine atleast one pixel as central pixel points in the target image; and

a training unit configured to set an initial weight value of thetraining model, to perform learning and training according to theinitial weight value, pixel values of each of the central pixel pointsand pixels around the central pixel points, and to obtain a certificatefeature model based on a neural network.

Furthermore, the determination unit may include:

a correction unit configured to correct an initial parameter of thecertificate feature model, if a distance difference between the positionof the certificate obtained according to the certificate feature modeland an actual position of the certificate is greater than or equal to apreset difference threshold value.

Furthermore, the correction unit may include:

a distance calculation unit configured to determine the distancedifference between the position of the certificate obtained according tothe certificate feature model and the actual position of thecertificate; and

a parameter correction unit configured to correct, if the distancedifference value is greater than or equal to the difference thresholdvalue, the initial parameter of the certificate feature model accordingto the formula expressed as follows:

${{w_{ij}\left( {k + 1} \right)} = {{w_{ij}(k)} - {\eta \frac{\partial{E(k)}}{\partial{w_{ij}(k)}}}}};$

wherein w_(ij)(k) is used to represent a weight value in kth training;w_(ij)(k+1) is used to represent a weight value in (k+1)th training; ηis used to represent a learning rate and η is greater than zero, E(k) isused to represent an expected value of a position of the certificateimage obtained by previously performed K times of training.

Furthermore, the processing unit 302 may include:

a chromatic aberration estimation unit configured to estimate an averagechromatic aberration of each of the pixel points in the original imageaccording to the component values of the pixel points in the originalimage in red, green, and blue color components;

a gain calculation unit configured to calculate a gain amount of each ofthe pixel points in red, green, and blue color components according tothe average chromatic aberration of each of the pixel points; and

a balance processing unit configured to correct, according to the gainamount, a color temperature of each of the pixel points in the originalimage to obtain the balance image.

In the present solution, the original image containing the certificateimage is acquired; the original image is obtained by the camera devicethrough photographing; the white balance processing is performed on theoriginal image according to the component values of each pixel point inthe original image in red, green, and blue color components, and thebalance image is obtained; the position of the certificate image in thebalance image is determined according to the pre-trained certificatefeature model; the certificate feature model is obtained by trainingbased on the historical certificate images, the certificate image modeland the preset initial weight value; the image of the certificate isextracted from the balance image according to the position of thecertificate image. The position of the certificate in the original imageis determined according to the certificate feature model, and thecertificate image in the image is extracted, so that the accuracy ofextracting the certificate image from the original image is improved.FIG. 4 illustrates a schematic diagram of a terminal device according toembodiment four of the present disclosure. As shown in FIG. 4, theterminal device 4 in this embodiment includes: a processor 40, a memory41 and a computer readable instruction 42 stored in the memory 41 andexecutable by the processor 40. The processor 40 is configured toimplement the steps in the embodiment of the certificate imageextraction method such as the steps 101-104 as shown in FIG. 1, whenexecuting the computer readable instruction 42. As an alternative, theprocessor 40 is configured to implement the functions of the variousmodules/units such as the units 301-304 shown in FIG. 3 in the variousdevice embodiments, when executing the computer readable instruction 42.

Exemplarily, the computer readable instruction 42 may be divided intoone or a plurality of modules/units, the one or plurality ofmodules/units are stored in the memory 41, and executed by the processor40 so as to implement the present disclosure. The one or plurality ofmodules/units can be a series of computer program instruction segmentsthat can accomplish particular functionalities, these instructionsegments are used for describing an executive process of the computerreadable instruction 42 in the terminal device 4.

The terminal device 4 may be a computing device such as a desktopcomputer, a notebook, a palm computer, and the like, the terminal device4 may include but is not limited to: the processor 40, the memory 41.The person of ordinary skill in the art may be aware of the fact that,FIG. 4 is merely an example of the terminal device 4, and is notconstituted as limitation to the terminal device 4, more or lesscomponents shown in FIG. 4 may be included, or some components ordifferent components can be combined; for example, the terminal device 4may also include an input and output device, a network access device, abus, etc.

The so called processor 40 may be CPU (Central Processing Unit), and canalso be other general purpose processor, DSP (Digital Signal Processor),ASIC (Application Specific Integrated Circuit), FGPA (Field-ProgrammableGate Array), or some other programmable logic devices, discrete gate ortransistor logic device, discrete hardware component, etc. The generalpurpose processor may be a microprocessor, or as an alternative, theprocessor can also be any conventional processor and so on.

The memory 41 may be an internal storage unit of the terminal device 4,such as a hard disk or a memory of the terminal device 4. The memory 41can also be an external storage device of the terminal device 4, such asa plug-in hard disk, a SMC (Smart Media Card), a SD (Secure Digital)card, a FC (Flash Card) equipped on the terminal device 4. Further, thememory 41 may not only include the internal storage unit of the terminaldevice 4 but also include the external storage device of the terminaldevice 4. The memory 41 is configured to store the computer program, andother procedures and data needed by the terminal device 4. The memory 41may also be configured to store data that has been output or being readyto be output temporarily.

The person of ordinary skilled in the art may be aware of that, a wholeor a part of flow process of implementing the method in the aforesaidembodiments of the present disclosure may be accomplished by usingcomputer program to instruct relevant hardware. The computer program maybe stored in a non-volatile computer readable storage medium, when thecomputer program is executed, the steps in the various methodembodiments described above may be included. Any references to memory,storage, databases, or other media used in the embodiments providedherein may include non-volatile and/or volatile memory. The non-volatilememory may include ROM (Read Only Memory), programmable ROM, EPROM(Electrically Programmable Read Only Memory), EEPROM (ElectricallyErasable Programmable Read Only Memory), or flash memory. The volatilememory may include RAM (Random Access Memory) or external cache memory.By way of illustration instead of limitation, RAM is available in avariety of forms such as SRAM (Static RAM), DRAM (Dynamic RAM), SDRAM(Synchronous DRAM), DDR (Double Data Rate) SDRAM, ESDRAM (EnhancedSDRAM), Synchlink DRAM, RDRAM (Rambus Direct RAM), DRDRAM (Direct RamBusDynamic RAM), and RDRAM (Rambus Dynamic RAM), etc.

As stated above, the foregoing embodiments are merely used to explainthe technical solutions of the present disclosure, and are not intendedto limit the technical solutions. Although the present disclosure hasbeen described in detail with reference to the foregoing embodiments,the ordinarily skilled one in the art should understand that thetechnical solutions described in the foregoing embodiments can still bemodified, or equivalent replacement can be made to some of the technicalfeatures. Moreover, these modifications or substitutions which do notmake the essences of corresponding technical solutions depart from thespirit and the scope of the technical solutions of the embodiments ofthe present disclosure should all be included in the protection scope ofthe present disclosure.

What is claimed is:
 1. A certificate image extraction method, performed on a terminal device, comprising: obtaining an original image containing a certificate image, wherein the original image is obtained by a camera device by means of photographing; performing white balance processing on the original image to obtain a balance image according to component values of pixel points in the original image in red, green and blue color components; determining a position of the certificate image in the balance image according to a pre-trained certificate feature model; wherein the certificate feature model is obtained by training based on historical certificate images, a certificate image model and a preset initial weight value; and extracting the certificate image from the balance image according to the position of the certificate image.
 2. The certificate image extraction method according to claim 1, wherein before the step of determining a position of the certificate from the balance image according to a pre-trained certificate feature model, further comprising: collecting historical certificate images, and obtaining a target image by screening the historical certificate images according to a preset target image requirement; recognizing pixels in the target image according to a preset certificate image template, and determining at least one pixel as central pixel points in the target image; setting an initial weight value of the training model, determining an output position of the certificate image according to the initial weight value, pixel values of each of the central pixel points and pixels around the central pixel points, and adjusting the initial weight value according to a difference value between the output position and a preset expected position so as to obtain a target weight value, and determining a certificate feature model based on a neural network according to the target weight value.
 3. The certificate image extraction method according to claim 2, wherein the step of determining a position of the certificate image in the balance image according to a pre-trained certificate feature model comprises: correcting an initial parameter of the certificate feature model, if a distance difference between the position of the certificate obtained according to the certificate feature model and an actual position of the certificate is greater than or equal to a preset difference threshold value.
 4. The certificate image extraction method according to claim 3, wherein the step of correcting an initial parameter of the certificate feature model, if a distance difference between the position of the certificate obtained according to the certificate feature model and an actual position of the certificate is greater than or equal to a preset difference value threshold comprises: determining the distance difference between the position of the certificate obtained according to the certificate feature model and the actual position of the certificate; correcting, if the distance difference value is greater than or equal to the difference threshold value, the initial parameter of the certificate feature model according to the formula expressed as follows: ${{w_{ij}\left( {k + 1} \right)} = {{w_{ij}(k)} - {\eta \frac{\partial{E(k)}}{\partial{w_{ij}(k)}}}}};$ wherein w_(ij)(k) is used to represent a weight value when a kth training is performed; w_(ij)(k+1) is used to represent a weight value when a (k+1)th training is performed; η is used to represent a learning rate and η>0, E(k) is used to represent an expected value of a position of the certificate image obtained by previously performed K times of training.
 5. The certificate image extraction method according to claim 1, wherein the step of performing white balance processing on the original image to obtain a balance image according to component values of pixel points in the original image in red, green and blue color components comprises: estimating an average chromatic aberration of each of the pixel points in the original image according to the component values of the pixel points in the original image in red, green, and blue color components; determining a gain amount of each of the pixel points in red, green, and blue color components according to the average chromatic aberration of each of the pixel points; and correcting, according to the gain amount, a color temperature of each of the pixel points in the original image to obtain the balance image.
 6. A terminal device, comprising a memory, a processor and a computer readable instruction stored in the memory and executable by the processor, the processor is configured to execute the computer readable instruction to implement following steps: obtaining an original image containing a certificate image, wherein the original image is obtained by a camera device by means of photographing; performing white balance processing on the original image to obtain a balance image according to component values of pixel points in the original image in red, green and blue color components; determining a position of the certificate image in the balance image according to a pre-trained certificate feature model; wherein the certificate feature model is obtained by training based on historical certificate images, a certificate image model and a preset initial weight value; and extracting the certificate image from the balance image according to the position of the certificate image.
 7. The terminal device according to claim 6, wherein before the step of determining a position of the certificate from the balance image according to a pre-trained certificate feature model, further comprising: collecting historical certificate images, and obtaining a target image by screening the historical certificate images according to a preset target image requirement; recognizing pixels in the target image according to a preset certificate image template, and determining at least one pixel as central pixel points in the target image; setting an initial weight value of the training model, determining an output position of the certificate image according to the initial weight value, pixel values of each of the central pixel points and pixels around the central pixel points, and adjusting the initial weight value according to a difference value between the output position and a preset expected position so as to obtain a target weight value, and determining a certificate feature model based on a neural network according to the target weight value.
 8. The terminal device according to claim 7, wherein the step of determining a position of the certificate image in the balance image according to a pre-trained certificate feature model comprises: correcting an initial parameter of the certificate feature model, if a distance difference between the position of the certificate obtained according to the certificate feature model and an actual position of the certificate is greater than or equal to a preset difference threshold value.
 9. The terminal device according to claim 8, wherein the step of correcting an initial parameter of the certificate feature model, if a distance difference between the position of the certificate obtained according to the certificate feature model and an actual position of the certificate is greater than or equal to a preset difference value threshold comprises: determining the distance difference between the position of the certificate obtained according to the certificate feature model and the actual position of the certificate; correcting, if the distance difference value is greater than or equal to the difference threshold value, the initial parameter of the certificate feature model according to the formula expressed as follows: ${{w_{ij}\left( {k + 1} \right)} = {{w_{ij}(k)} - {\eta \frac{\partial{E(k)}}{\partial{w_{ij}(k)}}}}};$ wherein w_(ij)(k) is used to represent a weight value when a kth training is performed; w_(ij)(k+1) is used to represent a weight value when a (k+1)th training is performed; η is used to represent a learning rate and η>0, E(k) is used to represent an expected value of a position of the certificate image obtained by previously performed K times of training.
 10. The terminal device according to claim 6, wherein the step of performing white balance processing on the original image to obtain a balance image according to component values of pixel points in the original image in red, green and blue color components comprises: estimating an average chromatic aberration of each of the pixel points in the original image according to the component values of the pixel points in the original image in red, green, and blue color components; determining a gain amount of each of the pixel points in red, green, and blue color components according to the average chromatic aberration of each of the pixel points; and correcting, according to the gain amount, a color temperature of each of the pixel points in the original image to obtain the balance image.
 11. A non-volatile computer readable storage medium, which stores a computer readable instruction, wherein the computer readable instruction is configured to be executed by a processor to cause the processor to implement following steps: obtaining an original image containing a certificate image, wherein the original image is obtained by a camera device by means of photographing; performing white balance processing on the original image to obtain a balance image according to component values of pixel points in the original image in red, green and blue color components; determining a position of the certificate image in the balance image according to a pre-trained certificate feature model; wherein the certificate feature model is obtained by training based on historical certificate images, a certificate image model and a preset initial weight value; and extracting the certificate image from the balance image according to the position of the certificate image.
 12. The non-volatile computer readable storage medium according to claim 11, wherein before the step of determining a position of the certificate from the balance image according to a pre-trained certificate feature model, the computer readable instruction is further configured to be executed by the processor to cause the processor to implement following steps:collecting historical certificate images, and obtaining a target image by screening the historical certificate images according to a preset target image requirement; recognizing pixels in the target image according to a preset certificate image template, and determining at least one pixel as central pixel points in the target image; setting an initial weight value of the training model, determining an output position of the certificate image according to the initial weight value, pixel values of each of the central pixel points and pixels around the central pixel points, and adjusting the initial weight value according to a difference value between the output position and a preset expected position so as to obtain a target weight value, and determining a certificate feature model based on a neural network according to the target weight value.
 13. The non-volatile computer readable storage medium according to claim 12, wherein the step of determining a position of the certificate image in the balance image according to a pre-trained certificate feature model comprises: correcting an initial parameter of the certificate feature model, if a distance difference between the position of the certificate obtained according to the certificate feature model and an actual position of the certificate is greater than or equal to a preset difference threshold value.
 14. The non-volatile computer readable storage medium according to claim 13, wherein the step of correcting an initial parameter of the certificate feature model, if a distance difference between the position of the certificate obtained according to the certificate feature model and an actual position of the certificate is greater than or equal to a preset difference value threshold comprises: determining the distance difference between the position of the certificate obtained according to the certificate feature model and the actual position of the certificate; correcting, if the distance difference value is greater than or equal to the difference threshold value, the initial parameter of the certificate feature model according to the formula expressed as follows: ${{w_{ij}\left( {k + 1} \right)} = {{w_{ij}(k)} - {\eta \frac{\partial{E(k)}}{\partial{w_{ij}(k)}}}}};$ wherein w_(ij)(k) is used to represent a weight value when a kth training is performed; w_(ij)(k+1) is used to represent a weight value when a (k+1)th training is performed; η is used to represent a learning rate and η>0, E(k) is used to represent an expected value of a position of the certificate image obtained by previously performed K times of training.
 15. The non-volatile computer readable storage medium according to claim 11, wherein the step of performing white balance processing on the original image to obtain a balance image according to component values of pixel points in the original image in red, green and blue color components comprises: estimating an average chromatic aberration of each of the pixel points in the original image according to the component values of the pixel points in the original image in red, green, and blue color components; determining a gain amount of each of the pixel points in red, green, and blue color components according to the average chromatic aberration of each of the pixel points; and correcting, according to the gain amount, a color temperature of each of the pixel points in the original image to obtain the balance image. 